<link rel="stylesheet" type="text/css" href="/libs/simditor/styles/simditor.css" />
<link rel="stylesheet" type="text/css" href="/css/editor.css" />
<script type="text/javascript" src="/libs/simple-module/lib/module.js"></script>
<script type="text/javascript" src="/libs/simple-hotkeys/lib/hotkeys.js"></script>
<script type="text/javascript" src="/libs/simple-uploader/lib/uploader.js"></script>
<script type="text/javascript" src="/libs/simditor/lib/simditor.js"></script>
<script type="text/javascript" src="/js/editor.js"></script>

<div class="container-fluid editor">
    <div class="row">
        <div class="col-md-2 sidebar-box">
            <div class="sidebar">
                <a class="btn btn-primary btn-back" href="/">回到主页</a>
                <div class="btn btn-primary btn-add">新建文章</div>
                <ul class="nav nav-pills nav-stacked">
                    {{#each essays}}
                    <li>
                        <a href="/editor/{{_id}}">  {{title}}  </a>
                        <span class="btn-del fa fa-times"></span>
                    </li>
                    {{/each}}
                </ul>
            </div>
        </div>

        <div class="col-md-offset-2 col-md-10 main-box">
            {{#if essay}}
            <form>
                <input type="hidden" value={{essay._id}} id="essay-id"></input>
                <input name="title" type="text" value={{essay.title}} id="essay-title" class="essay-title"></input>
                <button class="fa fa-floppy-o btn btn-primary btn-save" id="btn-save"></button>
                <textarea id="editor" placeholder="请输入文章内容">  {{essay.content}}</textarea>
            </form>
            {{/if}}
        </div>
    </div>
</div>